/*
Copyright 2025 PerfXLab (Beijing) Technologies Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#pragma once
#include "OpenSparseBLAS_func.h"
#include "OpenSparseBLAS_type.h"
#include <stdlib.h>

typedef union
{
    bool BOOL_value;
    int8_t INT8_value;
    int16_t INT16_value;
    int32_t INT32_value;
    int64_t INT64_value;
    uint8_t UINT8_value;
    uint16_t UINT16_value;
    uint32_t UINT32_value;
    uint64_t UINT64_value;
    float FP32_value;
    double FP64_value;
} Scalar_Value;

/**
 * @ingroup OpenSpB_scalar
 * @brief A structure to represent scalar.
 * @details This class stores basic information about a scalar.
 */
struct OpenSpB_scalar_opaque
{
    OpenSpB_type element_type; /**< Element data type */
    Scalar_Value value;    /**< Scalar value*/
};

OpenSpB_info OpenSpB_scalar_setZero(OpenSpB_scalar s);
